import React from 'react';
import { ProFormText } from '@ant-design/pro-components';

const BaseTextInput = ({ name, label, required = false,rules, ...rest }) => {
  if (rules === undefined) {
    rules  = []
  }
  rules = [...rules,{ required: required, message: `请输入${label}` }]

   return (
    <ProFormText
      name={name}
      label={label}
      width="xl"
      placeholder={`请输入${label}`}
      rules={rules}
      {...rest}
    />
  );
};

export default BaseTextInput;